package com.liu.service.impl;

import com.liu.entity.Question;
import com.liu.mapper.QuestionMapper;
import com.liu.service.QuestionService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Question)表服务实现类
 *
 * @author makejava
 * @since 2023-02-24 17:25:40
 */
@Service("questionServiceImpl")
@Transactional
public class QuestionServiceImpl implements QuestionService {
    @Resource
    private QuestionMapper questionMapper;

    @Override
    public Question queryById(Integer id) {
        return this.questionMapper.queryById(id);
    }

    @Override
    public List<Question> findAll(String problem) {
        return this.questionMapper.findAll(problem);
    }

    @Override
    public List<Question> findQueByUser(Integer id, String problem) {
        return this.questionMapper.findQueByUser(id,problem);
    }

    @Override
    public List<Question> queryAllByLimit(Integer pageNum, Integer pageSize, String problem) {
        return this.questionMapper.queryAllByLimit(pageNum, pageSize, problem);
    }

    @Override
    public long count(String problem) {
        return this.questionMapper.count(problem);
    }

    @Override
    public int insert(Question question) {
        return this.questionMapper.insert(question);
    }

    @Override
    public int insertBatch(List<Question> entities) {
        return this.questionMapper.insertBatch(entities);
    }

    @Override
    public int update(Question question) {
        return this.questionMapper.update(question);
    }

    @Override
    public int deleteById(Integer id) {
        return this.questionMapper.deleteById(id);
    }

    @Override
    public int deleteByIds(List<Integer> ids) {
        return this.questionMapper.deleteByIds(ids);
    }
}
